package br.com.knowledge.persistence.hibernate.entities;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.GenericGenerator;

/**
 * BcdTrigger entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "bcd_trigger", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = "id"))
public class BcdTrigger implements java.io.Serializable {

	// Fields

	private Integer idtrigger;
	private BcdTabelas bcdTabelas;
	private String nometrigger;
	private String tipoacao;
	private String execucao;
	private Integer id;
	private Set<AbdTriggerinferencia> abdTriggerinferencias = new HashSet<AbdTriggerinferencia>(
			0);
	private Set<AbdTriggerinferencia> abdTriggerinferencias_1 = new HashSet<AbdTriggerinferencia>(
			0);

	// Constructors

	/** default constructor */
	public BcdTrigger() {
	}

	/** minimal constructor */
	public BcdTrigger(BcdTabelas bcdTabelas, String nometrigger,
			String tipoacao, String execucao) {
		this.bcdTabelas = bcdTabelas;
		this.nometrigger = nometrigger;
		this.tipoacao = tipoacao;
		this.execucao = execucao;
	}

	/** full constructor */
	public BcdTrigger(BcdTabelas bcdTabelas, String nometrigger,
			String tipoacao, String execucao, Integer id,
			Set<AbdTriggerinferencia> abdTriggerinferencias,
			Set<AbdTriggerinferencia> abdTriggerinferencias_1) {
		this.bcdTabelas = bcdTabelas;
		this.nometrigger = nometrigger;
		this.tipoacao = tipoacao;
		this.execucao = execucao;
		this.id = id;
		this.abdTriggerinferencias = abdTriggerinferencias;
		this.abdTriggerinferencias_1 = abdTriggerinferencias_1;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "idtrigger", unique = true, nullable = false)
	public Integer getIdtrigger() {
		return this.idtrigger;
	}

	public void setIdtrigger(Integer idtrigger) {
		this.idtrigger = idtrigger;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "bcd_tabelas_id", nullable = false)
	public BcdTabelas getBcdTabelas() {
		return this.bcdTabelas;
	}

	public void setBcdTabelas(BcdTabelas bcdTabelas) {
		this.bcdTabelas = bcdTabelas;
	}

	@Column(name = "nometrigger", nullable = false, length = 256)
	public String getNometrigger() {
		return this.nometrigger;
	}

	public void setNometrigger(String nometrigger) {
		this.nometrigger = nometrigger;
	}

	@Column(name = "tipoacao", nullable = false, length = 1)
	public String getTipoacao() {
		return this.tipoacao;
	}

	public void setTipoacao(String tipoacao) {
		this.tipoacao = tipoacao;
	}

	@Column(name = "execucao", nullable = false, length = 1)
	public String getExecucao() {
		return this.execucao;
	}

	public void setExecucao(String execucao) {
		this.execucao = execucao;
	}

	@Column(name = "id", unique = true)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bcdTrigger")
	public Set<AbdTriggerinferencia> getAbdTriggerinferencias() {
		return this.abdTriggerinferencias;
	}

	public void setAbdTriggerinferencias(
			Set<AbdTriggerinferencia> abdTriggerinferencias) {
		this.abdTriggerinferencias = abdTriggerinferencias;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bcdTrigger")
	public Set<AbdTriggerinferencia> getAbdTriggerinferencias_1() {
		return this.abdTriggerinferencias_1;
	}

	public void setAbdTriggerinferencias_1(
			Set<AbdTriggerinferencia> abdTriggerinferencias_1) {
		this.abdTriggerinferencias_1 = abdTriggerinferencias_1;
	}

}